#ifndef CHECKERBOARDWIDGET_H
#define CHECKERBOARDWIDGET_H

#include <QWidget>
#include <QPoint>
#include <QMouseEvent>
#include <QTimer>

#include "ccontrol.h"

class CheckerboardWidget : public QWidget
{
    Q_OBJECT
public:
    explicit CheckerboardWidget(QWidget *parent = 0);

    void setControl(CControl* ctrl);

    void MoveBall(QStack<QPoint> path);

    void paintEvent(QPaintEvent *);

    void mousePressEvent(QMouseEvent *e);
signals:

public slots:

private:
    // 控制器
    CControl* m_ctrl;

    // 棋盘的尺寸
    int m_WidthSize, m_HeightSize;

    // 每个格子的尺寸
    float m_everyChecherWidth, m_everyChecherHeight;

    QTimer m_UpdateTimer;

};

#endif // CHECKERBOARDWIDGET_H
